package com.contextor.magiccards.model.user;

import com.contextor.magiccards.model.BaseEntity;

import javax.persistence.*;
import java.util.Date;

/**
 * User: sergey
 * Date: Mar 15, 2011 3:55:03 PM
 */
@Entity
@Table(name = "login_history")
public class LoginItem extends BaseEntity {

    @Temporal(value = TemporalType.TIMESTAMP)
    @Column(name = "date")
    private Date date;

    @Column(name = "ip_address")
    private String ip;

    public LoginItem() {
        this.date = new Date();
    }

    public LoginItem(User user, String ip) {
        super();
        this.ip = ip;
        this.user = user;
    }

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }
}
